The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time, computer systems have evolved into extremely sophisticated devices, and computer systems may be found in many different settings. Computer systems typically include a combination of hardware, such as semiconductors and circuit boards, and software, also known as computer programs. As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago. One significant advance in computer technology is the development of parallel processing, i.e., the performance of multiple tasks in parallel.
A number of computer software and hardware technologies have been developed to facilitate increased parallel processing. From a hardware standpoint, computers increasingly rely on multiple microprocessors to provide increased workload capacity. Furthermore, some microprocessors have been developed that support the ability to execute multiple threads in parallel, effectively providing many of the same performance gains attainable through the use of multiple microprocessors. From a software standpoint, multithreaded operating systems, kernels, and virtual machines have been developed, which permit computer programs to concurrently execute in multiple threads, so that multiple tasks can essentially be performed at the same time.
A thread is an execution path of instructions or statements. If multiple threads need to use the same object concurrently, a virtual machine manages access of the threads to objects via locks, in order to prevent interference and unpredictable behavior. A lock is a privilege to access an object that only one thread may possess at any one time. If a thread desires to lock a particular object, the thread requests a lock from the virtual machine. The virtual machine is a program that interprets an/or compiles the threads for execution on a processor.
One such multi-threaded system implemented as a virtual machine is JVM (Java Virtual Machine). A problem with building scalable Java applications is the limited tooling options available to give developers, testers, and production administrators the ability to understand how their multi-threaded applications contend for locks inside of the JVM. These tool options are needed to debug problems or aid in analysis of the application as it is being built.
Currently, the following techniques are used for gathering lock contention data from multi-threaded applications: manual analysis of thread dumps, profilers, and traces. A manual analysis of thread dumps can cause instability in the JVM and halt all operations inside of the JDK (Java Development Kit) when the thread dump occurs for as long as the thread dump executes, making it unrealistic for a production environment. A JVMPI (Java Virtual Machine Profiler Interface) profiler adds instrumentation code to threads, in order to give the user a view of whether the threads are waiting and for which locks the threads are waiting, but profilers pay a performance penalty because of the additional instrumentation code, which make them unrealistic for a production environment. A Java Lock Monitor trace, which is a profile of which locks are most highly contended during a period of time that the profiler is connected, also has the effect of attaching a JVMPI profiler and resultant instrumentation code, which again slows down the runtime significantly enough to make it unrealistic for a production environment.
Thus, what is needed is a better way to gather lock contention data for multi-threaded applications.